#include "Baby.h"

#include "imgui.h"

class ExampleLayer : public Baby::Layer
{
public:
	ExampleLayer()
		:Layer("Example")
	{
	}

	void OnUpdate() override
	{
		if (Baby::Input::IsKeyPressed(BY_KEY_TAB))
			BY_TRACE("Tab key is pressed!");
	}

	void OnImGuiRender() override 
	{
		ImGui::Begin("Test");
		ImGui::Text("Hello Baby Engine");
		ImGui::End();
	}

	void OnEvent(Baby::Event& event) override
	{
		if (event.GetEventType() == Baby::EventType::KeyPressed)
		{
			Baby::KeyPressedEvent& e = (Baby::KeyPressedEvent&)event;
			BY_TRACE("{0}", (char)e.GetKeyCode());
		}
	}
};


class SandBox : public Baby::Application
{
public:
	SandBox()
	{
		PushLayer(new ExampleLayer());
	}

	~SandBox()
	{

	}
};

Baby::Application* Baby::CreateApplication()
{
	return new SandBox();
}

